/*
 * 
 * 
 * 
 */
package com.cms.controller.admin;

import com.alibaba.fastjson.JSON;
import com.cms.Feedback;
import com.cms.entity.Content;
import com.cms.entity.PushContent;
import com.cms.routes.RouteMapping;
import com.jfinal.core.paragetter.Para;


/**
 * Controller - 内容
 * 
 * 
 * 
 */
@RouteMapping(url = "/admin/push/content")

public class PushContentController extends BaseController {

	/**
	 * 功能描述  添加统筹区的推送内容到数据库
	 * @date 2019/7/23
	 * @param content 推送内容
	 * @param city 推送来源城市
	 * @return void
	 */
	public void save(@Para("categoryId") String content, @Para("city") String city) {
		//获取各地统筹区推送到省本级的content内容
		Content con = JSON.parseObject(content, Content.class);
		//存
		PushContent pushContent = new PushContent();
		pushContent.setCreateDate(con.getCreateDate());
		pushContent.setModifyDate(con.getModifyDate());
		pushContent.setDescription(con.getDescription());
		pushContent.setDescription(con.getDescription());
		pushContent.setKeywords(con.getKeywords());
		pushContent.setTitle(con.getTitle());
		pushContent.setImage(con.getImage());
		pushContent.setIntroduction(con.getIntroduction());
		pushContent.setCategoryId(con.getCategoryId());
		pushContent.setModifyDate(con.getModifyDate());
		pushContent.setSiteId(con.getSiteId());
		//pushContent.setSource(con.getS);
		pushContent.setFromCity(city);
		pushContent.setIsCheck(0);
		pushContent.save();
		renderJson(Feedback.success("推送成功"));
	}

}